<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>Elementslib Usage Demo</title>
	<meta name="generator" content="TextMate http://macromates.com/">
	<meta name="author" content="Adam Christian">
	<!-- Date: 2008-09-18 -->
  
</head>
<body>
  <div id="test1">Div with ID test1</div>
  <input type="text" name="test2" value="Input named test2">
  <a href="http://www.google.com">Link to Google</a>
  <div class="myClass">Div with class myClass</div>
</body>
<script type="text/javascript" src="elementslib/elementslib.js"></script>
<script type="text/javascript" charset="utf-8">
  //Access by ID
  element = elementslib.Element.ID('test1');
  alert('first element id: '+ element.id);
  //Access by NAME
  element = elementslib.Element.NAME('test2');
  alert('second element value: '+ element.value);
  //Access by LINK
  element = elementslib.Element.LINK('Link to Google');
  alert('third element link: '+ element.href);
  //Access by CLASSNAME
  element = elementslib.Element.CLASSNAME('myClass,0');
  alert('fourth element className: '+ element.className);
  //Access by TAGNAME
  element = elementslib.Element.TAGNAME('input,0');
  alert('tagname element name: '+ element.name);
  //Access by XPATH
  element = elementslib.Element.XPATH('/html/body/div[1]');
  alert('xpath element id: '+ element.id);
</script>
</html>
